{% extends "../theme/base_edit.html" %}

{% block edit %}


<script type="text/javascript">
    $().ready(function () {
        $("#form_post").validate(
                {
                    rules: {
                        title: {
                            required: true
                        },
                        cnt_md: {
                            required: true
                        }
                    },
                    messages: {
                        title: {
                            required: "<span class='red'>请输入标题</span>"

                        },
                        cnt_md: {
                            required: "<span class='red'>请输入内容</span>"
                        }
                    }
                }
        );
    });
</script>



<div class="panel panel-black">
    <div class="panel-heading">添加地图</div>

    <div class="panel-body">
        <form method="post" class="form-horizontal" id="form_post" role="form">

            <fieldset>



                <div class="form-group">
                    <label for="title" class="col-sm-2 control-label">标题</label>

                    <div class="col-sm-10">
                        <input type="text" id="title" name="title" value="" class="form-control">
                    </div>
                </div>
                 <div class="form-group">
                    <label for="title" class="col-sm-2 control-label">ID</label>

                    <div class="col-sm-10">
                        <input type="text" id="ext_map_uid" name="ext_map_uid" value="" class="form-control">
                    </div>
                </div>




                <div class="form-group">
                    <label for="tags" class="col-sm-2 control-label">标签</label>

                    <div class="col-sm-10">
                        <input type="text" id="tags" name="tags" class="form-control" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label for="ext_lat" class="col-sm-2 control-label">lat</label>

                    <div class="col-sm-10">
                        <input type="text" id="ext_lat" name="ext_lat" class="form-control" value="">
                    </div>
                </div>


                <div class="form-group">
                    <label for="ext_lon" class="col-sm-2 control-label">lon</label>

                    <div class="col-sm-10">
                        <input type="text" id="ext_lon" name="ext_lon" class="form-control" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label for="ext_zoom_max" class="col-sm-2 control-label">zoom_max</label>

                    <div class="col-sm-10">
                        <input type="text" id="ext_zoom_max" name="ext_zoom_max" class="form-control"
                               value="">
                    </div>
                </div>


                <div class="form-group">
                    <label for="ext_zoom_min" class="col-sm-2 control-label">zoom_min</label>

                    <div class="col-sm-10">
                        <input type="text" id="ext_zoom_min" name="ext_zoom_min" class="form-control"
                               value="">
                    </div>
                </div>


                <div class="form-group">
                    <label for="ext_zoom_current" class="col-sm-2 control-label">zoom_current</label>

                    <div class="col-sm-10">
                        <input type="text" id="ext_zoom_current" name="ext_zoom_current" class="form-control"
                               value="">
                    </div>
                </div>

 {% for ii in range(0,5) %}
                <div class="form-group">
                    {% if ii == 0 %}
                    <label for="pcat0" class="col-sm-2 control-label">分类</label>
                    {% else %}
                    <label for="pcatx" class="col-sm-2 control-label"></label>
                    {% end %}

                    <div class="col-sm-3">
                        <select name="pcat{{ii}}" id="pcat{{ii}}" class="form-control"
                                onchange="g_load_infocat({{ii}})">
                            <option>请选择</option>
                            {% for taginfo in tag_infos %}
                            {% if taginfo.uid.endswith('00') %}
                            <option value="{{ taginfo.uid }}">{{ taginfo.name }}
                            </option>
                            {% else %}
                            {% end %}
                            {% end %}
                        </select>
                    </div>
                    <div class="col-sm-4">
                        <select name="gcat{{ii}}" id="gcat{{ii}}" class="form-control">

                        </select>
                    </div>
                </div>
                {% end %}




                <div class="form-group">
                    <label class="col-sm-2 control-label" for="logo">图片</label>

                    <div class="col-sm-10">

                        <input type="text" id="logo" name="logo" class="form-control" readonly/>

                        <br>

                        <a class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal">
                            上传图片
                        </a>

                    </div>
                </div>



                <div class="form-group">
                    <label for="cnt_md" class="col-sm-2 control-label">内容</label>

                    <div class="col-sm-10">
                        <textarea rows=16 id="cnt_md" name="cnt_md" cols="70" class="form-control"></textarea>
                    </div>
                </div>


                <div class="form-group">
                    <label for="sub1" class="col-sm-2 control-label"></label>

                    <div class="col-sm-10">
                        <input id="sub1" type="submit" value="更新数据" class="btn btn-primary">
                    </div>
                </div>
            </fieldset>
        </form>
         {% module upload_pic() %}
    </div>
</div>
{% end %}


